
<%@taglib	uri="http://displaytag.sf.net"              prefix="display" %>
            <%@taglib	uri="http://java.sun.com/jsp/jstl/sql"      prefix="sql"%>
            <%@taglib	uri="http://java.sun.com/jsp/jstl/core"     prefix="c" %>
            <%@taglib	uri="http://struts.apache.org/tags-html"    prefix="html" %>
            <%@taglib	uri="http://struts.apache.org/tags-bean"    prefix="bean" %>
            <%@taglib	uri="http://struts.apache.org/tags-logic"   prefix="logic" %>
            
            <%
            if (request.getParameter("idioma") != null){
                %><%@page import="org.apache.struts.Globals, java.util.Locale"%><%
                if (request.getParameter("idioma").equals("en")){
                    session.setAttribute(Globals.LOCALE_KEY, new Locale("en"));
                    }
                else if (request.getParameter("idioma").equals("es")){
                    session.setAttribute(Globals.LOCALE_KEY, new Locale("es"));
                    }
                else if (request.getParameter("idioma").equals("fr")){
                    session.setAttribute(Globals.LOCALE_KEY, new Locale("fr"));
                    }
                }
            %>

            <script type="text/javascript" language="JavaScript">
            <!--
            function enviar(cad){
                if(cad != "listado"){
                    document.getElementById("method").value = cad;
                    document.getElementsByTagName("form")[0].submit();
                    }
                else{
                    var temp = document.getElementsByTagName("form")[0].name;
                    self.location.href = "<%=request.getContextPath()%>/Listado" + temp.slice(0, temp.length - 4) +".do?method=" + cad;
                    }
                }

            function clean(){ document.getElementsByTagName('form')[0].reset();}

            function css(cad){ document.getElementsByTagName('body')[0].setAttribute("class", cad); }

            function stopRKey(evt) {
                var evt = (evt) ? evt : ((event) ? event : null);
                var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
                if ((evt.keyCode == 13) && (node.type=="text"))  {return false;}
                }
            document.onkeypress = stopRKey;

            function impr() {
                var ventimp = window.open(' ', 'popimpr');
                ventimp.document.write("<link rel='stylesheet' type='text/css' href='<%=request.getContextPath()%>/recursos/css/celeste.css' /><center>");
                ventimp.document.write(document.getElementById("page").innerHTML);
                ventimp.document.close(); ventimp.print(); ventimp.close();
                }

            function close(){
                document.getElementById("error").style.display = "none";
                }

            document.getElementsByTagName("body")[0].setAttribute("onload", "javascript: end();");
            function end(){
                if(document.getElementById("error").innerHTML.length == 0)
                    document.getElementById("error").style.display = "none";
                else{
                    var arreglo = document.getElementById("error").innerHTML.split("<br>");
                    var text = "";
                    for(i = 0; i < arreglo.length - 1; i++)
                        text += "<li>" + arreglo[i] + "</li>";
                    document.getElementById("error").innerHTML = "<div style='margin-bottom:-30px;'><a href='javascript:close()'><img src='<%=request.getContextPath()%>/recursos/cerrar.png'/></a></div><br/><fieldset>"
                    + text + "<center><a href='javascript: history.back();'><img src='<%=request.getContextPath()%>/recursos/volver.png' /><span><bean:message key="all.regresar" /></span></a></center><legend align='center'><bean:message key="all.error" /></legend></fieldset></div>";
                    document.getElementById("error").style.display = "block";
                    }
                }
            //-->
            </script>